<?php

function factorial($n) : int {
    if ($n == 0) {
        return 1;
    }
    return $n * factorial($n - 1);
}

$result = factorial(5);
echo $result; // 120

function fibonacci($n) : int {
    if ($n == 0 || $n == 1) {
        return $n;
    }
    return fibonacci($n - 1) + fibonacci($n - 2);
}

echo PHP_EOL;
echo fibonacci(10); // 55